#pragma once

#include <vector>
#include "xmldocument.h"
#include "xmltoolbarview.h"

typedef std::vector <CString>		V_CString;

#define ID_MYTOOLBAR_BUTTON1		WM_USER + 1
#define ID_MYTOOLBAR_BUTTONLAST		WM_USER + 100

#define CONST_TOOLBAR_XML_SEPRAATOR_TAG	_T("Separator")
// XmlToolBar

class CXmlToolBar : public CToolBar
{
	DECLARE_DYNAMIC(CXmlToolBar)

public:
	//instance of CXmlToolBarView class 
	CXmlToolBarView *TBView;
	//array for toolbar items
	CArray <CString, CString> m_items;
	//attribute for items
	CString m_attr;
	int m_id;

public:
	CXmlToolBar();
	virtual ~CXmlToolBar();

protected:
	DECLARE_MESSAGE_MAP()

protected:
	virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);

private:
	// Variable for storing tool tip text
	V_CString m_asToolTips;
	// veriable for xml doc persing
	CXmlDocument m_xmldoc;
	// veriable for image path for toolbar buttons
	CString m_path;
	// toolbar button count
	int tbbCnt;

public:
	// Inserts tool tips text consecutively
	void InsertToolTip(CString sToolTip);
	// Retrieve Tool Tip text
	CString GetToolTip(UINT nID);
	// Parse XML document for toolbar configuration and command id set to initially 1025
	CString TraceXml(CString filename, CString attr, int id = 1025);
	// Load the array of toolbar button names
	void LoadtbButtonInfo(CXmlElement * pElement);
	// Load toolbar buttons and image
	BOOL OnDrawToolBar();
	// set the button sizes
	void SetButtonSize(int cx, int cy); 
	// get the toolbar bitmap image path
	BOOL GetImgPath();
	// load the bitmap image path from xml file
	void LoadImgPathInfo(CXmlElement * pElement);

};


